package com.swzl.model.wx.controller;

import com.github.pagehelper.PageInfo;
import com.swzl.bean.School;
import com.swzl.common.web.request.PageDoMain;
import com.swzl.common.web.response.Result;
import com.swzl.common.web.response.ResultController;
import com.swzl.constant.ControllerConstant;
import com.swzl.model.wx.service.SchoolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author fog
 * @date 2024年11月03日 17:27
 */

@RestController
@Api(tags = {"学校信息控制层"})
@RequestMapping(ControllerConstant.API_WX_PREFIX + "school/")
public class SchoolController extends ResultController {

    @Resource
    private SchoolService schoolService;

    @GetMapping("schoolInfo")
    @ApiOperation(value = "所有学校信息")
    public Result getSchoolInfo(PageDoMain pageDoMain, School school) {

        PageInfo<School> schoolInfo = schoolService.getSchoolInfo(pageDoMain, school);

        return success(schoolInfo);
    }

}
